﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AdminCmsArticleUpdateControl.ascx.cs"
    Inherits="BIS.Portal.Modules.CMS.Adm.AdminCmsArticleUpdateControl" %>

<script src='<%# ModulePath +"tinymce/jscripts/tiny_mce/tiny_mce.js" %>' type="text/javascript"></script>

<script src="JS/jquery-1.4.2.js" type="text/javascript"></script>

<script src='<%# ModulePath + "JS/jquery-ui/jquery.ui.datepicker.js" %>' type="text/javascript"></script>

<script type="text/javascript" language="javascript">
    $(document).ready(function() {
        $("#<%=txtPostDate.ClientID %>").datepicker();
    });
</script>

<script type="text/javascript" language="javascript">
    tinyMCE.init({
        // General options
        mode: "exact",
        elements: '<% =txtContent.ClientID %>',
        theme: "advanced",
        plugins: "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu, paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount",

        // Theme options
        theme_advanced_buttons1: "save,newdocument,|,bold,italic,underline,strikethrough,|, justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,| ,outdent,indent,blockquote,|,undo,redo,|,link,unlink, anchor,image,cleanup,help,code,|,insertdate,inserttime, preview,|,forecolor,backcolor",
        theme_advanced_buttons3: "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions, iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4: "insertlayer,moveforward,movebackward,absolute,|, styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking, template,pagebreak",
        theme_advanced_toolbar_location: "top",
        theme_advanced_toolbar_align: "left",
        theme_advanced_statusbar_location: "bottom",
        theme_advanced_resizing: true,

        // Example content CSS (should be your site CSS)
        content_css: "css/content.css",

        // Drop lists for link/image/media/template dialogs
        template_external_list_url: "lists/template_list.js",
        external_link_list_url: "lists/link_list.js",
        external_image_list_url: "lists/image_list.js",
        media_external_list_url: "lists/media_list.js",

        // Replace values for the template plugin
        template_replace_values: {
            username: "Some User",
            staffid: "991234"
        }
    });
</script>

<style type="text/css">
    .content
    {
        width: 900px;
        background: #fafcfc;
        border-color: #83ffff;
        border: 1px;
    }
    .childen
    {
        border-color: Navy;
        width: 900px;
        clear: both;
    }
    .left
    {
        width: 140px;
        float: left;
    }
    .middle
    {
        width: 380px;
        float: left;
    }
    .middles
    {
        width: 760px;
        float: left;
    }
    .right
    {
        width: 380px;
        float: left;
    }
    .a
    {
        color: #FF0000;
        font-weight: bold;
    }
    .list
    {
        height: 150px;
        overflow: scroll;
        border: 2px solid #CCCCCC;
    }
    #waper
    {
        width: 1024px;
        height: auto;
        margin-left: 50px;
    }
    .b
    {
        height: 35px;
        width: 900px;
    }
</style>
<div id="waper">
    <div class="content">
        <div class="b">
            <asp:Label ID="Label1" runat="server" ForeColor="Red" Font-Size="Medium" Text=""></asp:Label>
        </div>
        <div class="childen">
            <div class="left">
                <b>Nhóm nội dung</b></div>
            <div class="middle">
                <b>Nhóm nội dung chính(</b><span class="a">*</span>)</div>
            <div class="right">
                Nhóm Nội Dung</div>
        </div>
        <%--********--%>
        <div class="childen">
            <div class="left">
                &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="radBLCatagoryName"
                    ErrorMessage="Phải nhập nội dung"></asp:RequiredFieldValidator>
            </div>
            <div class="middle">
                <div class="list">
                    <asp:RadioButtonList ID="radBLCatagoryName" runat="server">
                    </asp:RadioButtonList>
                </div>
            </div>
            <div class="right">
                <div class="list">
                    <asp:CheckBoxList ID="chkBLCatagoryName" runat="server">
                    </asp:CheckBoxList>
                </div>
            </div>
        </div>
        <%-----*--------%>
        <div class="b">
            <asp:Label ID="lblErrorRad" ForeColor="Red" Font-Size="Medium" runat="server" Width="50px" />
            <asp:Label ID="lblErrorChk" ForeColor="Red" Font-Size="Medium" runat="server" Width="50px" />
        </div>
        <%--********--%>
        <div class="childen">
            <div class="left">
                <b>PageAlias(</b><span class="a">*</span>)</div>
            <div class="middles">
                <asp:DropDownList ID="ddlPageAlias" runat="server" Width="300px" Height="20px">
                </asp:DropDownList>
                <%--<asp:TextBox ID="txtPageAlias" runat="server" Width="350px"></asp:TextBox>--%>
                <asp:Label ID="lblErrorPage" ForeColor="Red" Font-Size="Medium" runat="server"></asp:Label>
            </div>
        </div>
        <%-----*--------%>
        <div class="b">
            &nbsp;
        </div>
        <%--*********---%>
        <div class="childen">
            <div class="left">
                <b>Tittle(</b><span class="a">*</span>)</div>
            <div class="middles">
                <asp:TextBox ID="txtTitle" runat="server" Width="461px"></asp:TextBox>
                <asp:Label ID="lblErrorTitle" ForeColor="Red" Font-Size="Medium" runat="server"></asp:Label>
                <asp:RequiredFieldValidator ID="RFV" runat="server" 
                    ControlToValidate="txtTitle" ErrorMessage="*"></asp:RequiredFieldValidator>
            </div>
        </div>
        <%-----*--------%>
        <div class="b">
            &nbsp;
        </div>
        <%--*********---%>
        <div class="childen">
            <div class="left">
                Meta keyword</div>
            <div class="middles">
                <asp:TextBox ID="txtMetaKey" runat="server" Width="500px"></asp:TextBox>
            </div>
        </div>
        <%-----*--------%>
        <div class="b">
            &nbsp;
        </div>
        <%--*********---%>
        <div class="childen">
            <div class="left">
                Description</div>
            <div class="middles">
                <asp:TextBox ID="txtDescription" TextMode="MultiLine" Height="80px" runat="server"
                    Width="500px"></asp:TextBox>
            </div>
        </div>
        <%-----*--------%>
        <div class="b">
            &nbsp;
        </div>
        <%--*********---%>
        <div class="childen">
            <div class="left">
                <b>Content(</b><span class="a">*</span>)</div>
            <div class="middles">
                <asp:TextBox ID="txtContent" TextMode="MultiLine" Height="320px" runat="server" Width="750px"></asp:TextBox>
            </div>
        </div>
        <%-----*--------%>
        <div class="b">
            &nbsp;
        </div>
        <div class="childen">
            <asp:Label ID="lblErrorContent" ForeColor="Red" Font-Size="Medium" runat="server"></asp:Label>
        </div>
        <div class="childen">
            <div class="left">
                Ảnh minh họa</div>
            <div class="middles">
                <asp:TextBox ID="txtThumbImage" runat="server" Width="250"></asp:TextBox>
                <input type="button" id="btnChooseThumbImage" value="Browser" causesvalidation="False" />
            </div>
        </div>
        <%-----*--------%>
        <div class="b">
            &nbsp;
        </div>
        <%---*********** ---%>
        <div class="childen">
            <div class="left">
                Ảnh chi tiết</div>
            <div class="middles">
                <asp:TextBox ID="txtFullImage" runat="server" Width="250"></asp:TextBox>
                <input type="button" id="btnChooseFullImage" value="Browser" causesvalidation="False" /></div>
        </div>
        <%-----*--------%>
        <div class="b">
            &nbsp;
        </div>
        <%---*********** ---%>
        <div class="childen">
            <div class="left">
                &nbsp;
            </div>
            <div class="middles">
                <asp:CheckBox ID="chkIsHotArticle" runat="server" Text="Là tin nổi bật" /></div>
        </div>
        <%-----*--------%>
        <div class="b">
            &nbsp;
        </div>
        <%---*********** ---%>
        <div class="childen">
            <div class="left">
                <b>Ngôn ngữ(</b><span class="a">*</span>)</div>
            <div class="middles">
                <asp:DropDownList ID="ddlLanguage" runat="server" Width="250px">
                    <asp:ListItem Value="1">Tiếng Việt</asp:ListItem>
                    <asp:ListItem Value="2">Tiếng Anh</asp:ListItem>
                </asp:DropDownList>
            </div>
        </div>
        <%-----*--------%>
        <div class="b">
            &nbsp;
        </div>
        <%---*********** ---%>
        <div class="childen">
            <div class="left">
                <b>Ngày đăng(</b><span class="a">*</span>)</div>
            <div class="middles">
                <asp:TextBox ID="txtPostDate" runat="server" Width="246px"></asp:TextBox>
                <asp:Label ID="lblErorPostDate" ForeColor="Red" Font-Size="Medium" runat="server"></asp:Label>
            </div>
        </div>
        <%-----*--------%>
        <div class="b">
            &nbsp;
        </div>
        <%-----*--------%>
        <div class="childen">
            <div class="left">
                Piority
            </div>
            <div class="middles">
                <asp:TextBox ID="txtPriority" runat="server" Width="246px"></asp:TextBox>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtPriority"
                    ErrorMessage="Bạn vừa nhập không phải là số. Hãy nhập lại" ValidationExpression="\d*[0-9]"></asp:RegularExpressionValidator>
            </div>
        </div>
        <%-----*--------%>
        <div class="b">
            &nbsp;
        </div>
        <%-----*--------%>
        <div class="childen">
            <div class="left">
                Status
            </div>
            <div class="middles">
                <asp:DropDownList ID="ddlStatus" runat="server" Height="25px" Width="245px">
                    <asp:ListItem Value="0">Tạm ẩn</asp:ListItem>
                    <asp:ListItem Value="1">Hiển thị</asp:ListItem>
                    <asp:ListItem Value="99">Xóa logic</asp:ListItem>
                </asp:DropDownList>
                <%--<asp:TextBox ID="txtStatus" runat="server" Width="246px"></asp:TextBox>--%>
                <%--<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="ddlStatus"
                ErrorMessage="Bạn vừa nhập không phải là số. Hãy nhập lại" ValidationExpression="\d*[0-9]"></asp:RegularExpressionValidator>--%>
            </div>
        </div>
        <%-----*--------%>
        <div class="b">
            &nbsp;
        </div>
        <%-----******* -----%>
        <div class="childen">
            <div style="width: 340px; float: left">
                &nbsp;
            </div>
            <div class="middle">
                <asp:Button ID="btnAddNew" runat="server" Text="Thêm Mới" Visible="false" OnClick="btnAddNew_Click" />
                <asp:Button ID="btnUpdate" runat="server" Width="80px" Text="Cập nhật" OnClick="btnUpdate_Click" />
                &nbsp;&nbsp;
                <asp:Button ID="btnCancel" runat="server" Width="80px" Text="Bỏ qua" CausesValidation="False"
                    OnClick="btnCancel_Click" Style="height: 26px" /></div>
        </div>
        <asp:HiddenField ID="hiddenIsPostBack" Value="false" runat="server" />
    </div>
</div>

<script type="text/javascript">
    $(document).ready(function() {
        $("#btnChooseFullImage").click(function() {
            var url = '<%=FTPFileManagmentURL %>';
            if (url != '')
                var wins = window.open("<%=FTPFileManagmentURL %>?res=<%=txtFullImage.ClientID %>", "FTP Management", "scrollbars=1,  width=1000,height=560");
            else
                alert("Chưa thiết lập trang quản lý tập tin !");
        });
        $("#btnChooseThumbImage").click(function() {
            var url = '<%=FTPFileManagmentURL %>';
            if (url != '')
                var wins = window.open("<%=FTPFileManagmentURL %>?res=<%=txtThumbImage.ClientID %>", "FTP Management", "scrollbars=1,  width=1000,height=560");
            else
                alert("Chưa thiết lập trang quản lý tập tin !");
        });
        $("input#<%=hiddenIsPostBack.ClientID %>").val("true");
    });
</script>

